<div class="orders form">
<?php echo $this->Form->create('Order');?>
	<fieldset>
		<legend><?php __('Añadir Pedido'); ?></legend>
	<?php
		echo $this->Form->input('id', array('label' => 'Id'));
		echo $this->Form->input('date', array('label' => 'Fecha Emision', 'type' => 'text'));
		echo $this->Form->input('amount', array('label' => 'Cantidad'));
		echo $this->Form->input('article_id', array('label' => 'Articulo', 'default' => $art_id));
		if(!empty($ultimo_proveedor)){
                    echo $this->Form->input('supplier_id', array('label' => 'Proveedor', 'default' => $ultimo_proveedor[0]['suppliers']['id']));
                }else{
                    echo $this->Form->input('supplier_id', array('label' => 'Proveedor'));
                }
		echo $this->Form->input('date_recibed', array('label' => 'Fecha Recibido', 'type' => 'hidden','disabled' => 'disabled'));
		echo $this->Form->input('amount_recibed', array('label' => 'Cantidad Recibida', 'type' => 'hidden', 'disabled' => 'disabled'));
	?>
	</fieldset>
<?php echo $this->Form->end(__('Crear', true));?>
</div>
<script type="text/javascript">
    (function($){
        // Date picker
        $("#OrderDate").datepicker({
            //yearRange: '1970:2010',
            defaultDate: new Date(),
            dateFormat: 'dd/mm/yy',
            changeMonth: true,
            changeYear: true
        });
        
        //toda la documentacion de esta librería la encontras aca
        //http://jqueryui.com/demos/datepicker/
    })(jQuery);
</script>
<script type="text/javascript">
    (function($){
        // Date picker
        $("#OrderDateRecibed").datepicker({
            //yearRange: '1970:2010',
            defaultDate: new Date(),
            dateFormat: 'dd/mm/yy',
            changeMonth: true,
            changeYear: true
        });
        
        //toda la documentacion de esta librería la encontras aca
        //http://jqueryui.com/demos/datepicker/
    })(jQuery);
</script>